package com.fesine.ch02.StringAndSyn;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/6 19:14
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/6 19:14
 */
public class Service {
    public static void print(String string) {
        try {
            synchronized (string) {
                while (true) {
                    System.out.println(Thread.currentThread().getName());
                    Thread.sleep(1000);
                }
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
